% 使用 tikz-3dplot 绘制圆柱
\tdplotsetmaincoords{50}{0}
\begin{tikzpicture}[tdplot_main_coords, >=Stealth, scale=0.7]
    \pgfmathsetmacro{\r}{1}
    \pgfmathsetmacro{\h}{3}

    \draw plot[smooth,variable=\t,domain=\tdplotmainphi:\tdplotmainphi-180]
            ({\r*cos(\t)},{\r*sin(\t)},\h)
        -- plot[smooth,variable=\t,domain=\tdplotmainphi-180:\tdplotmainphi]
            ({\r*cos(\t)},{\r*sin(\t)},0) -- cycle;
    \draw plot[smooth,variable=\t,domain=0:360] ({\r*cos(\t)},{\r*sin(\t)},\h);
    \draw [dashed] plot[smooth,variable=\t,domain=0:360] ({\r*cos(\t)},{\r*sin(\t)},0);

    \coordinate (O) at (0, 0, \h);      % 上底圆心
    \coordinate (A) at ({\r*cos(-50}, {\r*sin(-50)}, \h);
    \coordinate (B) at ({\r*cos(40}, {\r*sin(40)}, \h);

    \coordinate (O') at (0, 0, 0);      % 下底圆心
    \coordinate (A') at ({\r*cos(-50}, {\r*sin(-50)}, 0);
    \coordinate (B') at ({\r*cos(40}, {\r*sin(40)}, 0);
    \coordinate (C') at ({\r*cos(180}, {\r*sin(180)}, 0);

    \draw [dash dot] ($(O)!1.5!(A)$) -- ($(O)!-1.5!(A)$);
    \draw [dash dot] ($(O)!1.5!(B)$) -- ($(O)!-1.5!(B)$);

    \draw [dash dot] ($(O')!1.5!(A')$) -- ($(O')!-1.5!(A')$);
    \draw [dash dot] ($(O')!1.5!(B')$) -- ($(O')!-1.5!(B')$);
    \draw (O) -- (O') node [midway, right] {$h$};
    \draw [->] (O') -- (C') node [pos=0.6, above, inner sep=0.1em] {$r$};
\end{tikzpicture}
